package com.example.gkcircle.library.object;

import java.io.Serializable;

import com.avos.avoscloud.AVUser;
import com.example.gkcircle.utils.ACache;

import android.content.Context;

/**
 * 
 * @ClassName: UserObject
 * @Description: TODO(用户object类)
 * @author ZhouHua
 * @date 2015年9月4日 下午5:37:07
 *
 */
public class GKUser extends AVUser implements Serializable {

	private static final long serialVersionUID = 1L;

	private String nickname;
	private String userId;
	private String userName;
	private String password;
	private Boolean sex;
	private String department;
	private String grade;
	private String email;
	private Integer verifyEmail;
	private String phone;
	private String userIconUrl;

	public Integer getVerifyEmail() {
		return verifyEmail;
	}

	public void setVerifyEmail(Integer verifyEmail) {
		this.verifyEmail = verifyEmail;
	}

	public String getUserIconUrl() {
		return userIconUrl;
	}

	public void setUserIconUrl(String userIconUrl) {
		this.userIconUrl = userIconUrl;
	}

	public String getUserId() {
		return userId;
	}

	public void setUserId(String userId) {
		this.userId = userId;
	}

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public Boolean getSex() {
		return sex;
	}

	public void setSex(Boolean sex) {
		this.sex = sex;
	}

	public String getDepartment() {
		return department;
	}

	public void setDepartment(String department) {
		this.department = department;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getPhone() {
		return phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public String getNickname() {
		return nickname;
	}
	public void setNickname(String nickname) {
		this.nickname = nickname;
	}

	public String getGrade() {
		return grade;
	}

	public void setGrade(String grade) {
		this.grade = grade;
	}

	/**
	 * @Title: getCurrentUser
	 * @Description: (获取当前用户对象)
	 */
	public static GKUser getCurrentUser(Context context) {
		ACache mCache = ACache.get(context);
		GKUser user = (GKUser) mCache.getAsObject("User");
		return user;
	}

	/**
	 * @Title: getCurrentUser
	 * @Description: (保存当前用户对象)
	 */
	public static void setCurrentUser(Context context, GKUser user) {
		ACache mCache = ACache.get(context);
		mCache.put("User", user);
	}

	
	/**
	 * @Title: getCurrentUser
	 * @Description: (退出登录)
	 */
	public static void LogOut(Context context) {
		ACache mCache = ACache.get(context);
		mCache.remove("officeCookie");
		mCache.remove("libraryCookie");
		mCache.remove("User");
	}



}
